<?php 
require_once 'Admin/Model/geshouModel.php';
require 'Controller.php';
 class geshoucontroller extends Controller{
 	 function __construct()
 	{
 		parent::__construct();
 		 $this->mod=new geshouModel();
 	}
 	//显示用户列表
 	 function listgeshous()
 	{

 		//$geshoumod=new geshouModel();
 		$geshoudata=$this->mod->getgeshouList();
 		$this->assign("geshous",$geshoudata);//将$geshoudata查出的数据赋值给geshous
 		$this->display();
 	}
 	//显示添加用户的页面
 	public function geshouform()
 	{
 		$this->display();
 	}
 	//添加用户，写入数据库
 	public function addgeshou()
 	{
 		$result=$this->mod->addgeshouInfo();
 		if($result)
 		{
 			echo '添加成功<br>';
 			echo "<a href='index1.php?c=geshou&m=listgeshous'>返回首页</a>";
      //<a href='index1.php?c=geshou&m=listgeshous'>点击查看</a>
 		}
 		else
 		{
 			echo '添加失败';
 			echo "<a href='index1.php?c=geshou&m=geshouform'>点击重新添加</a>";
 		}		
}
			//修改用户信息
			public function editgeshou()
 		{
 			$data=$this->mod->getgeshoubyID();
 			$this->assign('geshou',$data);
 			$this->display();

 		} 
 		 public function updategeshou(){
        $result=$this->mod->updategeshouInfo();
        if($result==true){
          echo '更新成功！<br>';
          echo ' <a href="index1.php?c=geshou&m=listgeshous">如果没有跳转，请点这里跳转</a>';
        }

      }
      public function delgeshou(){
      	$data=$this->mod->delgeshoubyID();
      	if($data==true)
      	{
      		echo '删除成功！<br>';
          echo ' <a href="index1.php?c=geshou&m=listgeshous">如果没有跳转，请点这里跳转</a>';
      	}
      }

}
 ?>